/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mysweethome.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author BKC
 */
@Entity
@Table(name = "DirectoryInfo", catalog = "MySweetHomeDB", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "DirectoryInfo.findAll", query = "SELECT d FROM DirectoryInfo d"),
    @NamedQuery(name = "DirectoryInfo.findByDirectoryInfoID", query = "SELECT d FROM DirectoryInfo d WHERE d.directoryInfoID = :directoryInfoID"),
    @NamedQuery(name = "DirectoryInfo.findByPhone", query = "SELECT d FROM DirectoryInfo d WHERE d.phone = :phone"),
    @NamedQuery(name = "DirectoryInfo.findByAddress", query = "SELECT d FROM DirectoryInfo d WHERE d.address = :address"),
    @NamedQuery(name = "DirectoryInfo.findByEmail", query = "SELECT d FROM DirectoryInfo d WHERE d.email = :email"),
    @NamedQuery(name = "DirectoryInfo.findByDescription", query = "SELECT d FROM DirectoryInfo d WHERE d.description = :description"),
    @NamedQuery(name = "DirectoryInfo.findByName", query = "SELECT d FROM DirectoryInfo d WHERE d.name = :name"),
    @NamedQuery(name = "DirectoryInfo.findByCompany", query = "SELECT d FROM DirectoryInfo d WHERE d.company = :company")})
public class DirectoryInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "DirectoryInfoID")
    private Integer directoryInfoID;
    @Column(name = "Phone")
    private String phone;
    @Column(name = "Address")
    private String address;
    @Column(name = "Email")
    private String email;
    @Column(name = "Description")
    private String description;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Column(name = "Company")
    private String company;
    @JoinColumn(name = "DirectoryID", referencedColumnName = "DirectoryID")
    @ManyToOne(optional = false)
    private Directory directory;

    public DirectoryInfo() {
    }

    public DirectoryInfo(Integer directoryInfoID) {
        this.directoryInfoID = directoryInfoID;
    }

    public DirectoryInfo(Integer directoryInfoID, String name) {
        this.directoryInfoID = directoryInfoID;
        this.name = name;
    }

    public Integer getDirectoryInfoID() {
        return directoryInfoID;
    }

    public void setDirectoryInfoID(Integer directoryInfoID) {
        this.directoryInfoID = directoryInfoID;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public Directory getDirectory() {
        return directory;
    }

    public void setDirectory(Directory directory) {
        this.directory = directory;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (directoryInfoID != null ? directoryInfoID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DirectoryInfo)) {
            return false;
        }
        DirectoryInfo other = (DirectoryInfo) object;
        if ((this.directoryInfoID == null && other.directoryInfoID != null) || (this.directoryInfoID != null && !this.directoryInfoID.equals(other.directoryInfoID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mysweethome.entities.DirectoryInfo[directoryInfoID=" + directoryInfoID + "]";
    }

}
